package com.globalwave.common.entity;

import java.sql.Timestamp;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

@Entity
@Table(name = "SYNC_CONTROL")
public class SyncControl {
	final public static String STATUS_RUNNING = "R" ;
	final public static String STATUS_SUCCESS = "S" ;
	final public static String STATUS_FAIL = "F" ;
	
    @Id
    @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="increment")
    @GenericGenerator(name="SYNC_CONTROL_ID_SEQ", strategy = "increment")
    @Column(name="sync_control_id")
    private Long syncControlId ;
    
    @Column(name="source_db_code")
	private String sourceDbCode    ;

    @Column(name="sync_config_code")
	private String syncConfigCode      ;
    
    @Column(name="current_long_id")
	private Long currentLongId     ;

    @Column(name="current_string_id")
	private String currentStringId ;

    @Column(name="status")
	private String status            ;

    @Column(name="start_on")
	private Timestamp startOn       ;

    @Column(name="end_on")
	private Timestamp endOn         ;

    @Column(name="error_event_log_id")
	private Long errorEventLogId  ;

    @Column(name="error_times")
	private Integer errorTimes      ;
	
	public String getSourceDbCode() {
		return sourceDbCode;
	}
	public void setSourceDbCode(String sourceDbCode) {
		this.sourceDbCode = sourceDbCode;
	}
	public String getSyncConfigCode() {
		return syncConfigCode;
	}
	public void setSyncConfigCode(String syncConfigCode) {
		this.syncConfigCode = syncConfigCode;
	}
	public Long getCurrentLongId() {
		return currentLongId;
	}
	public void setCurrentLongId(Long currentLongId) {
		this.currentLongId = currentLongId;
	}
	public String getCurrentStringId() {
		return currentStringId;
	}
	public void setCurrentStringId(String currentStringId) {
		this.currentStringId = currentStringId;
	}
	public String getStatus() {
		return status;
	}
	public void setStatus(String status) {
		this.status = status;
	}
	public Timestamp getStartOn() {
		return startOn;
	}
	public void setStartOn(Timestamp startOn) {
		this.startOn = startOn;
	}
	public Timestamp getEndOn() {
		return endOn;
	}
	public void setEndOn(Timestamp endOn) {
		this.endOn = endOn;
	}
	public Long getErrorEventLogId() {
		return errorEventLogId;
	}
	public void setErrorEventLogId(Long errorEventLogId) {
		this.errorEventLogId = errorEventLogId;
	}
	public Integer getErrorTimes() {
		return errorTimes;
	}
	public void setErrorTimes(Integer errorTimes) {
		this.errorTimes = errorTimes;
	}
	public Long getSyncControlId() {
		return syncControlId;
	}
	public void setSyncControlId(Long syncControlId) {
		this.syncControlId = syncControlId;
	}
	
}
